package com.xie.smfs.effect;

import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory;
import net.minecraft.entity.player.PlayerEntity;

public class StarvingGhostCurseEffect extends StatusEffect implements ICurseEffect {
    public StarvingGhostCurseEffect() {
        super(StatusEffectCategory.HARMFUL, 0x660000); // 暗红色效果
    }

    @Override
    public boolean canApplyUpdateEffect(int duration, int amplifier) {
        return true; // 每tick执行效果
    }

    @Override
    public void applyUpdateEffect(LivingEntity entity, int amplifier) {
        if (entity instanceof PlayerEntity player && !player.isDead()) {
            // 持续减少饥饿值
            player.addExhaustion(0.025F);
            // 可以添加其他效果如减速、视觉扭曲等
        }
    }
}